import request from '@/util/request.js'

export const userRegisterService = (registerData)=>{
    //由于传过来的参数是js形式，所以要进行URLSearchParams完成传递
    const params = new URLSearchParams()
    for(let key in registerData){
        params.append(key,registerData[key])
    }
    return request.post('/user/register',params);
}

export const userLoginService = (loginData)=>{
    const params = new URLSearchParams()
    for(let key in loginData){
        params.append(key,loginData[key])
    }
    return request.post('/user/login',params)
}

//获取登录用户信息
export const infoService = ()=>{
    return request.get('/user/info')
}

//修改用户信息
export const userUpdateService = (inforData)=>{
    return request.put('/user/update',inforData)
}